﻿// =================================================================
//  Copyright (c) "David R. Guindo", Software architect
//  
//  This code is released under the terms of the Apache License, Version 2.0,
//  http://www.apache.org/licenses/LICENSE-2.0
//  
//  THIS CODE AND INFORMATION ARE PROVIDED WITHOUT WARRANTIES,
//  WITHOUT LIMITING COMMERCIAL OR PARTICULAR USE.
// =================================================================

namespace ScreenManager.Configuration
{
   using System;
   using System.Configuration;

   public class ScreenManagerSection : ConfigurationSection
   {
      [ConfigurationProperty("maximize", DefaultValue = "true", IsRequired = false)]
      public Boolean Maximize
      {
         get
         {
            return (Boolean)this["maximize"];
         }
         set
         {
            this["maximize"] = value;
         }
      }

      [ConfigurationProperty("redirectionOnNoAvailable", DefaultValue = "true", IsRequired = false)]
      public Boolean RedirectionOnNoAvailable
      {
         get
         {
            return (Boolean)this["redirectionOnNoAvailable"];
         }
         set
         {
            this["redirectionOnNoAvailable"] = value;
         }
      }

      [ConfigurationProperty("windows", IsDefaultCollection = false, IsRequired = true)]
      [ConfigurationCollection(typeof(WindowCollection), AddItemName = "window", ClearItemsName = "clear",
         RemoveItemName = "remove")]
      public WindowCollection Windows
      {
         get
         {
            return this["windows"] as WindowCollection;
         }
      }
   }
}